<?php
	//ALLOWS A USER TO SUBMIT A CAMP THROUGH THIS FORM!
 
	// No direct access
	defined('_JEXEC') or die('Restricted access'); 
	
	// Add a reference to a CSS file
	// The default path is 'media/system/css/'
	JHTML::script("validation.js", "components/com_summercamps/js/", false);//false=do not load mootools
?>

<p>Test Paragraph </p>
<h2>Submit a Summer Camp</h2>
<h3><a href="index.php?option=com_summercamps">< Back to camp listings (cancel)</a></h3>

<form class="camp" action="index.php" method="post" name="adminForm" id="adminForm">
<div class="col100">
	<fieldset class="adminform">
		<!--  <legend><?php //echo JText::_( 'Camp Details' ); ?></legend>-->

<table class="camp">
<tr><td class="fieldtitle large">
	<?php echo JText::_( 'Camp Name' ); ?>	</td>
	<td><input class="fulltext large" type="text" name="CampName" id="CampName" 
		size="32" maxlength="256" value="" /></td> </tr>
		
<tr><td class="fieldtitle">
	<?php echo JText::_( 'Region' ); ?></td>
	<td>
		<select name="Region">
			<option value="Coastal">Coastal</option>
			<option value="Interior">Interior</option>
			<option value="North">North</option>
			<option value="Vancouver Island">Vancouver Island</option>
		</select></td></tr>

<tr><td class="fieldtitle">
	<?php echo JText::_( 'City' ); ?>	</td>
	<td><input class="text" type="text" name="City" id="City" 
		size="32" maxlength="64" value="" /></td></tr>
<tr><td  class="fieldtitle">
	<?php echo JText::_( 'Postal Code' ); ?>	</td>
	<td><input class="text_area" type="text" name="PostalCode" id="PostalCode" 
		size="7" maxlength="7" value="" /><span class="hint">ex: A5A 5A5</span></td></tr>
		
<tr><td  class="fieldtitle">
	<?php echo JText::_( 'Minimum Age' ); ?>	</td>
	<td><input class="text_area" type="text" name="MinAge" id="MinAge" 
		size="3" maxlength="2" value="0" onblur="validateAges('MinAge', 'MaxAge', 'MinAgeid', 'MaxAgeid');"/>
		<span id="MinAgeid" class="hint">Leave as 0 for no minimum</span></td></tr>
		
<tr><td  class="fieldtitle">
	<?php echo JText::_( 'Maximum Age' ); ?></td>
	<td><input class="text_area" type="text" name="MaxAge" id="MaxAge" 
		size="3" maxlength="3" value="0" onblur="validateAges('MinAge', 'MaxAge', 'MinAgeid', 'MaxAgeid');"/>
		<span id="MaxAgeid" class="hint">Leave as 0 for no maximum</span></td></tr>
		
<tr><td  class="fieldtitle">
	<?php echo JText::_( 'StartDate' ); ?>	</td>
	<td>
	<?php
	$currdate = substr(date('c'), 0, 10);
	 echo JHTML::calendar($currdate,'StartDate','StartDate','%Y-%m-%d');
	?>
	<br><span id="idStartDate" class="hint">YYYY-MM-DD</span></td></tr>		
						
<tr><td  class="fieldtitle">
	<?php echo JText::_( 'End Date' ); ?>	</td>
	<td><?php

		$fivedaysahead = substr( date('c', mktime(0, 0, 0, date("m"), date("d")+5)), 0, 10);
	 	echo JHTML::calendar($fivedaysahead,'EndDate','EndDate','%Y-%m-%d');
		?>
		<br><span id="idEndDate" class="hint">YYYY-MM-DD</span></td></tr>
		
<tr><td  class="fieldtitle">
	<?php echo JText::_( 'Description' ); ?>	</td>
	<td><textarea rows="6" cols="20" name="Description" 
		onclick="validateDate('EndDate', 'idEndDate');validateDate('StartDate', 'idStartDate'); compareDates('StartDate', 'EndDate', 'idStartDate','idEndDate');">
		</textarea></td></tr><!--  all the onclick items in the description check the date fields -->
	
<tr><td  class="fieldtitle">
	<?php echo JText::_( 'Contact Name' ); ?>	</td>
	<td><input class="text" type="text" name="ContactName" id="ContactName" 
		size="32" maxlength="128" value="" /></td></tr>
		
<tr><td class="fieldtitle">Contact Name Visible?</td>
	<td><input type="radio" name="ContactNameVisible" value="1" checked="checked"/> Yes
	<input class="RadioNo"type="radio" name="ContactNameVisible" value="0"/> No 
	</td></tr>
<tr><td class="fieldtitle">
	<?php echo JText::_( 'Email' ); ?></td>
	<td><input class="text" type="text" name="Email" id="Email" 
		size="32" maxlength="128" value="" /></td></tr>
		
<!--  <tr><td class="fieldtitle"> Email Visible?</td>
	<td><input type="radio" name="EmailVisible" value="1" /> Yes
	<input class="RadioNo"type="radio" name="EmailVisible" value="0" /> No 
	</td></tr>-->
		
<tr><td class="fieldtitle">
	<?php echo JText::_( 'Website' ); ?>	</td>
	<td><input class="fulltext" type="text" name="Website" id="Website" 
		size="32" maxlength="128" value="" /></td></tr>
		
<tr><td class="fieldtitle">
	<?php echo JText::_( 'Phone Number' ); ?>	</td>
	<td><input class="phone" type="text" name="Phone" id="Phone" 
		size="32" maxlength="24" value="" /></td></tr>
		
<tr><td class="fieldtitle">Phone Number Visible?</td>
	<td><input type="radio" name="PhoneVisible" value="1"/> Yes
	<input class="RadioNo" type="radio" name="PhoneVisible" value="0" checked="checked"/> No 
	</td></tr>
<tr><td class="fieldtitle"></td>
	<td><input class="submitbtn" type="submit" value="Submit" />
	</td></tr>
				
	</table>
	</fieldset>
</div>

<input type="hidden" name="Approved" value="0" />
<input type="hidden" name="option" value="com_summercamps" />
<input type="hidden" name="ID" value="" />
<input type="hidden" name="task" value="save" />
<input type="hidden" name="controller" value="single"/>

</form>